<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      const arr = [
        {
          id: 0,
          title: '商务出行',
        },
        {
          id: 1,
          title: '医疗转运',
        },
        {
          id: 2,
          title: '航空货运',
        },
        {
          id: 3,
          title: '婚礼包机',
        },
        {
          id: 4,
          title: '爱宠出行',
        },
        {
          id: 5,
          title: '团体出行',
        },
      ]
    </script>
    <script>
      var str = 'name=devin&age=123' // json字符串 "{ "name":"devin", "age": "123" }"
      // 'name":"devin","age":"123'
      var str1 = JSON.parse('{"' + str.replace(/\&/g, '","').replace(/\=/g, '":"') + '"}')
      console.log(str1, 'str')
    </script>
  </body>
</html>
